//
//  UserInfoTableViewCell.m
//  BGM
//
//  Created by 我要变好看 on 2018/12/19.
//  Copyright © 2018 com.alirtc.demo. All rights reserved.
//

#import "UserInfoTableViewCell.h"
#import "Common.h"
#import "SVProgressHUD.h"
#import "UIImageView+WebCache.h"

@interface UserInfoTableViewCell()

@property (nonatomic, strong)UIImageView *headImage;
@property (nonatomic, strong)UILabel *nameLabel;

@end


@implementation UserInfoTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self != nil) {
        self.headImage = [[UIImageView alloc]initWithFrame:CGRectMake(30, 15, 50, 50)];
        self.headImage.layer.cornerRadius = 25;
        self.headImage.layer.masksToBounds = YES;
        [self addSubview:self.headImage];
        
        self.nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(90, 10, 200, 40)];
        self.nameLabel.textColor = bgmmainColor;
        self.nameLabel.font = [UIFont systemFontOfSize:15];
        [self addSubview:self.nameLabel];
        
        
        UILabel *line = [[UILabel alloc]initWithFrame:CGRectMake(0, 79, SCREENW, 0.3)];
        line.backgroundColor = [UIColor grayColor];
        line.alpha = 0.3;
        [self addSubview:line];
    }
    return self;
}
- (void)setUserInfo:(NSDictionary *)dic{
     if (dic.count ==0) {
        return;
    }
     NSString *url = [NSString stringWithFormat:@"%@",[dic objectForKey:@"aUsersHead"]];
    [self.headImage sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamed:@"headImage"]];
    self.nameLabel.text = [NSString stringWithFormat:@"%@",[dic objectForKey:@"aUsersName"]];
    
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
